package com.ruoyi.consume.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.consume.mapper.PesticideConsumeMapper;
import com.ruoyi.consume.domain.PesticideConsume;
import com.ruoyi.consume.service.IPesticideConsumeService;

/**
 * 查看领用信息Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-23
 */
@Service
public class PesticideConsumeServiceImpl implements IPesticideConsumeService
{
    @Autowired
    private PesticideConsumeMapper pesticideConsumeMapper;

    /**
     * 查询查看领用信息
     *
     * @param pesticideConsumeId 查看领用信息ID
     * @return 查看领用信息
     */
    @Override
    public PesticideConsume selectPesticideConsumeById(Long pesticideConsumeId)
    {
        return pesticideConsumeMapper.selectPesticideConsumeById(pesticideConsumeId);
    }

    /**
     * 查询查看领用信息列表
     *
     * @param pesticideConsume 查看领用信息
     * @return 查看领用信息
     */
    @Override
    public List<PesticideConsume> selectPesticideConsumeList(PesticideConsume pesticideConsume)
    {
        return pesticideConsumeMapper.selectPesticideConsumeList(pesticideConsume);
    }

    /**
     * 新增查看领用信息
     *
     * @param pesticideConsume 查看领用信息
     * @return 结果
     */
    @Override
    public int insertPesticideConsume(PesticideConsume pesticideConsume)
    {
        pesticideConsume.setCreateTime(DateUtils.getNowDate());
        return pesticideConsumeMapper.insertPesticideConsume(pesticideConsume);
    }

    /**
     * 修改查看领用信息
     *
     * @param pesticideConsume 查看领用信息
     * @return 结果
     */
    @Override
    public int updatePesticideConsume(PesticideConsume pesticideConsume)
    {
        pesticideConsume.setUpdateTime(DateUtils.getNowDate());
        return pesticideConsumeMapper.updatePesticideConsume(pesticideConsume);
    }

    /**
     * 批量删除查看领用信息
     *
     * @param pesticideConsumeIds 需要删除的查看领用信息ID
     * @return 结果
     */
    @Override
    public int deletePesticideConsumeByIds(Long[] pesticideConsumeIds)
    {
        return pesticideConsumeMapper.deletePesticideConsumeByIds(pesticideConsumeIds);
    }

    /**
     * 删除查看领用信息信息
     *
     * @param pesticideConsumeId 查看领用信息ID
     * @return 结果
     */
    @Override
    public int deletePesticideConsumeById(Long pesticideConsumeId)
    {
        return pesticideConsumeMapper.deletePesticideConsumeById(pesticideConsumeId);
    }

    /**
     * 获取用户下拉框
     *
     * @param
     * @return 结果
     */
    @Override
    public List<PesticideConsume> getUserName(){
        return pesticideConsumeMapper.getUserName();
    }
}
